package com;

import java.io.File;

public class DeleteDir {
	public static void main(String[] args) {
		File file = new File("d:\\aa");
		delDir(file);
	}

	private static void delDir(File file) {
		File[] fs = file.listFiles();
		if (fs.length > 0) {
			for (File f : fs) {
				if (f.isDirectory())
					delDir(f);
				else {
					f.delete();
					System.out.println(f.getPath() + "....deleted!");
				}
			}
		}

		file.delete();
		System.out.println(file.getPath() + "....deleted<dir>!");
	}
}
